package com.zhongkun.datahome.service.constant;

import com.zhongkun.datahome.common.utils.StringUtils;

/**
 * @Author: huangjie
 * @Date: 2025/4/15 14:31
 * @Desc
 */
public enum TaskStatusEnum {
    PROCESSING("processing", "处理中"),
    FINISH("finish", "已完成");

    private String type;
    private String desc;

    TaskStatusEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static String getTaskStatusName(String taskType) {
        for (TaskStatusEnum taskTypeEnum : TaskStatusEnum.values()) {
            if (StringUtils.equals(taskTypeEnum.getType(), taskType)) {
                return taskTypeEnum.getDesc();
            }
        }
        return "";
    }

    public String getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }
}
